Skip to contents

Returns the arguments set with set_args as fit_models would pass them, with any model_spec value converted to a one-sided formula. Use it to fit a spec outside fit_models.

Usage

spec_args(spec)

Arguments

spec

A model_spec object.

Value

A named list, which is empty if the spec does not have any extra arguments.

See also

Examples

m <- model_spec(x1, x2) |> set_args(nominal = model_spec(x1))
spec_args(m)
#> $nominal
#> ~x1
#> <environment: 0x62b09ed39cb8>
#> 

# Fitting a spec by hand
# do.call(ordinal::clm,
#         c(list(to_formula(m, "y"), data = d), spec_args(m)))